/*
 * @Company: TSBVN
 * @Author: marcusbui
 * @Revision: May 12, 2011
 */
package tsb.com.html5.file.dao;

import java.util.List;

import tsb.com.html5.base.BaseDao;
import tsb.com.html5.file.item.FileItem;
import tsb.com.html5.file.param.GetFileParam;

/**
 * The Class CommentDao.
 */
public class FileDao extends BaseDao implements IFileDao {

	/**
	 * Instantiates a new comment dao.
	 */
	public FileDao() {
		super();
	}

	public FileItem getFileById(GetFileParam parm) throws Exception {
		FileItem obj = null;
		try {
			obj = (FileItem) getSqlMapClientTemplate().queryForObject(
					"FileMap.selectFile", parm);
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return obj;
	}
	
	public List<FileItem> getAllFiles() throws Exception {
		List<FileItem> returnList = null;
		try {
			returnList = (List<FileItem>) getSqlMapClientTemplate().queryForList(
					"FileMap.selectFile", new GetFileParam());
		} catch (Exception e) {
			e.printStackTrace();
			throw e;
		}
		return returnList;
	}


}
